package com.mega.ycy.mixin;

import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.fml.common.eventhandler.ASMEventHandler;
import net.minecraftforge.fml.common.eventhandler.Event;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(value = ASMEventHandler.class, remap = false)
public class ASMEventHandlerMixin {
    @Inject(method = "invoke", at = @At("HEAD"),  cancellable = true)
    public void invoke(Event event, CallbackInfo ci) {
        if (event instanceof LivingEvent)
            ci.cancel();
    }
}
